package com.gitee.wsl.common.ui.input


/**
 * User action defined on a mouse event.
 */
enum class UserAction {

    /**
     * The user action is highlighting some data.
     */
    Highlight,

    /**
     * The user action is selecting some data.
     */
    Select,

    /**
     * The user action is adding data to the current selection.
     */
    SelectionAdd,

    /**
     * The user action is removing data from the current selection.
     */
    SelectionRemove,

    /**
     * The user action is zooming in or out.
     */
    Zoom,

    /**
     * The user action is panning (moving the chart).
     */
    Pan,

    /**
     * Reset the Chart view.
     */
    ResetView,

    /**
     * No action.
     */
    None;

    /**
     * Is it a zoom or any selection?
     */
    internal val zoomOrSelect
        get() = this == Zoom || anySelect

    /**
     * Is it any selection?
     */
    internal val anySelect
        get() = this == Select || this == SelectionAdd || this == SelectionRemove
}
